package com.ruoyi.loupan.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.loupan.mapper.TbAlbumMapper;
import com.ruoyi.loupan.domain.TbAlbum;
import com.ruoyi.loupan.service.ITbAlbumService;

/**
 * 相册Service业务层处理
 * 
 * @author wukaige
 * @date 2021-06-30
 */
@Service
public class TbAlbumServiceImpl implements ITbAlbumService 
{
    @Autowired
    private TbAlbumMapper tbAlbumMapper;

    /**
     * 查询相册
     * 
     * @param id 相册ID
     * @return 相册
     */
    @Override
    public TbAlbum selectTbAlbumById(Long id)
    {
        return tbAlbumMapper.selectTbAlbumById(id);
    }

    /**
     * 查询相册列表
     * 
     * @param tbAlbum 相册
     * @return 相册
     */
    @Override
    public List<TbAlbum> selectTbAlbumList(TbAlbum tbAlbum)
    {
        return tbAlbumMapper.selectTbAlbumList(tbAlbum);
    }

    /**
     * 新增相册
     * 
     * @param tbAlbum 相册
     * @return 结果
     */
    @Override
    public int insertTbAlbum(TbAlbum tbAlbum)
    {
        tbAlbum.setCreateTime(DateUtils.getNowDate());
        return tbAlbumMapper.insertTbAlbum(tbAlbum);
    }

    /**
     * 修改相册
     * 
     * @param tbAlbum 相册
     * @return 结果
     */
    @Override
    public int updateTbAlbum(TbAlbum tbAlbum)
    {
        return tbAlbumMapper.updateTbAlbum(tbAlbum);
    }

    /**
     * 批量删除相册
     * 
     * @param ids 需要删除的相册ID
     * @return 结果
     */
    @Override
    public int deleteTbAlbumByIds(Long[] ids)
    {
        return tbAlbumMapper.deleteTbAlbumByIds(ids);
    }

    /**
     * 删除相册信息
     * 
     * @param id 相册ID
     * @return 结果
     */
    @Override
    public int deleteTbAlbumById(Long id)
    {
        return tbAlbumMapper.deleteTbAlbumById(id);
    }
}
